{extend name="public:base" /}
{block name="content"}
<div class="page-header">
	<h1>
		{$breadcrumb1}
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$breadcrumb4}
		</small>
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$crumbs}
		</small>
		<button id="send" form="form-goods" type="submit" style="float:right;margin-right: 10%"  class="btn btn-sm btn-primary">提交</button>
	</h1>
</div>
<div class="row">
	<div class="col-xs-12">
		<div class="panel-body">
			<form action="{:url('Contract/money_add')}" method="post" enctype="multipart/form-data" id="form-goods" class="form-horizontal">
				<ul class="nav nav-tabs">
					<li class="active"><a href="#tab-data" data-toggle="tab">基本信息</a></li>
				</ul>
				<div class="tab-content">

					<!-- 基本信息 START -->
					<div class="tab-pane active" id="tab-data">
						<div class="form-group required">
							<label class="col-sm-2 control-label" for="min_price">最小价格：</label>
							<div class="col-sm-4">
								<input id="min_price" class="form-control" type="number" placeholder="最小价格" step="0.01" value="" name="min_price">
							</div>
						</div>
						<div class="form-group required">
							<label class="col-sm-2 control-label" for="max_price">最大价格：</label>
							<div class="col-sm-4">
								<input id="max_price" class="form-control" type="number" placeholder="最大价格" step="0.01" value="" name="max_price">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label" for="remark">备注：</label>
							<div class="col-sm-4">
								<textarea class="form-control" name="remark" id="remark" ></textarea>
							</div>
						</div>
					</div>
					<!-- 基本信息 END -->
				</div>
			</form>
		</div>
	</div>
</div>
{/block}
{block name="javascript"}

<script src="__PUBLIC__/js/ckeditor/ckeditor.js"></script>
<script>

	$('#send').click(function(){

		var contract	=$("#contract_id option:selected"); //获取选中的项
		var time		=$("#time_id option:selected"); //获取选中的项
		var min=$('input[name="min_price"]').val();
		var max=$('input[name="max_price"]').val();

		var send=true;

		if(contract.val()==''){
			alert('必须选择一个合约');
			return false;
		}
		if(time.val()==''){
			alert('必须选择一个周期');
			return false;
		}
		if(min==''){
			alert('请填写最小价格');
			return false;
		}
		if(max==''){
			alert('请填写最大价格');
			return false;
		}

		if(send==true){
			return true;
		}
		return false;
	});

	//CKEDITOR
	CKEDITOR.replace('content', {
		filebrowserImageUploadUrl: '{:url("FileManager/ckupload")}',
		toolbar: [
			[ 'Source', 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ],
			[ 'FontSize', 'TextColor', 'BGColor' ],
			[ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock','Image','Format']
		]
	});

	/*******************************************************************************************************************/

</script>
{/block}